﻿using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;

namespace 仆从暴击
{
    internal class MinionCriticalHits : GlobalProjectile
	{		
		public override void ModifyHitNPC(Projectile projectile, NPC target, ref NPC.HitModifiers modifiers)
        {
            float critChance = ModContent.GetInstance<Configs>().CritChance / 100f;
            if (projectile.minion || ProjectileID.Sets.MinionShot[projectile.type] && Main.rand.NextFloat() <= critChance)
			{
				 modifiers.SetCrit();
			}
		}
	}
    public class Configs : ModConfig
    {
        public override ConfigScope Mode => ConfigScope.ClientSide;
        [Range(0f, 100f)]        
        public float CritChance;
    }
}
